#ifndef FRAMEBUFFERHANDLER_H
#define FRAMEBUFFERHANDLER_H

#include <stdlib.h>
#include <glew.h>
#include <glut.h>

#pragma comment(lib,"glew32.lib")

#define TEX 0
#define DEP 1

typedef struct  
{
	GLenum target;
	GLenum interFormat;
	GLenum format;
	GLenum* buffers;
	GLuint type;
	int width;
	int height;
	int texNum;
	GLuint ID;
	GLuint* texID;
}GPUFBO;

class FrameBufferHandler
{
public:
	FrameBufferHandler(void);
	~FrameBufferHandler(void);

	void    SetUpFBO(int bufferType, int width, int height, int texNum=1, GLenum interFormat=GL_RGB32F_ARB, GLenum format=GL_RGB, GLuint type=GL_FLOAT, GLenum target=GL_TEXTURE_2D);
	void	InitTexBuffer();
	void	InitDepBuffer();
	void	FBOActivate();
	void	FBODeactivate();
	void	SetBufferID(GLuint ID);

	float	*buffer;

public:
	GPUFBO	framebuffer;
	int bufferType;
};

#endif


